package com.example.aopdemo.aop.service.impl;

import com.example.aopdemo.aop.RecordOperationLog;
import com.example.aopdemo.aop.domain.SaveOrder;
import com.example.aopdemo.aop.domain.UpdateOrder;
import com.example.aopdemo.aop.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author luo
 * @since 2022/12/12 16:39
 */
@Slf4j
@Service
public class OrderServiceImpl implements OrderService {


    @RecordOperationLog(orderIdName = "id")
    @Override
    public long saveOrder(SaveOrder saveOrder) {


        log.info("保存订单：{}",saveOrder);

        return saveOrder.getId();

    }

    @RecordOperationLog(orderIdName = "orderId")
    @Override
    public void updateOrder(UpdateOrder updateOrder) {

        log.info("更新订单：{}",updateOrder);
    }



}
